package com.smile.data.entity

import com.baomidou.mybatisplus.annotation.FieldFill
import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonFormat
import io.swagger.annotations.ApiModelProperty
import lombok.AllArgsConstructor
import lombok.Data
import lombok.NoArgsConstructor
import java.time.LocalDateTime

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("smile_user")
class UserEntity {
    @ApiModelProperty("用户ID")
    var id: String = ""

    @ApiModelProperty("用户账号")
    var username: String? = null

    @ApiModelProperty("用户密码")
    var password: String? = null

    @ApiModelProperty("用户邮箱")
    var email: String? = null

    @ApiModelProperty("用户状态")
    var status: String? = null

    @TableField(value = "createdAt", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var createdAt: LocalDateTime? = null

    @TableField(value = "updatedAt", fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    var updatedAt: LocalDateTime? = null
}